/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entities;

import persistance.model.User;

/**
 * taka klasa prostego przekazywacza danych usera, żeby nie przekazywać całej klasy user,
 * żeby nie przekazywać klasy user z logiką (THINK: ?)
 * @author Bobok
 */
public class UserInfo {
    private String username;
    private String name;
    private String surname;
    private String email;
    private User userData;

    public String getEmail() {
        return email;
    }

    public String getName() {
        return name;
    }

    public String getSurname() {
        return surname;
    }

    public String getUsername() {
        return username;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setSurname(String surname) {
        this.surname = surname;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public UserInfo() {
    }

    public UserInfo(User user){
        setUsername(user.getUsername());
        setName(user.getName());
        setSurname(user.getSurname());
        setEmail(user.getEmail());

        userData = user;
    }

    public boolean isInRole(String role) {
        return userData.isInRole(role);
    }
}
